﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AccountManagement
{
    class Program
    {
        static void Main(string[] args)
        {
            Management m = new Management();
            bool isExit = false;
            while (! isExit)
            {
                Console.WriteLine("本系统提供两种功能：");
                Console.WriteLine("1、创建账户；2、显示所有账户信息；3、取钱; 4、注销删除账户；5、退出系统") ;
                string function = Console.ReadLine();
                string name;
                switch (function)
                {
                    case ("1"):
                        Console.WriteLine("请输入姓名");
                        name = Console.ReadLine();
                        Console.WriteLine("请选择账户类型：A个人账户；B统筹账户");
                        string type = Console.ReadLine();
                        m.AddAccount(type, name);
                        break;
                    case ("2"):
                        m.ShowAll();
                        break;
                    case ("3"):
                        Console.WriteLine("请输入姓名");
                        name = Console.ReadLine();
                        Console.WriteLine("请输入取钱金额：");
                        string money = Console.ReadLine();
                        m.RetrieveMoney(name, money);
                        break;
                    case ("4"):
                        Console.WriteLine("请输入姓名");
                        name = Console.ReadLine();
                        m.DeleteAccount(name);
                        break;
                    case ("5"):
                        isExit = true;
                        break;
                    default: break;
                }
              
            }
        }
    }
}
